package com.koocloud.electroplatemanage.mapper;

import com.koocloud.electroplatemanage.pojo.IncomePartJudgeVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * @program: electroplatemanage
 * @description: 来料接收与判定Mapper接口
 * @author: zww
 * @create: 2020-10-08 15:55
 */
@Mapper
public interface IncomePartJudgeMapper {
    //通过id序查询一条记录
    IncomePartJudgeVo selectById(String id);
    //根据工单号查找一条数据
    IncomePartJudgeVo selectByWorkOrderNumber(String workOrderNumber);
    //通过pk查询一条记录
    IncomePartJudgeVo selectByPk(@Param("id") String id, @Param("sql") String sql);
    //查询所有记录
    List<LinkedHashMap> selectAllData(@Param("sql") String sql,@Param("beginTime") String beginTime ,@Param("endTime")String endTime,@Param("idOrName")String idOrName);
    //查询所有记录
    List<LinkedHashMap> selectByDeleteFlag(@Param("sql") String sql,@Param("beginTime") String beginTime ,@Param("endTime")String endTime,@Param("idOrName")String idOrName,@Param("state")String state);
    //插入一条记录
    int insert(@Param("incomePartJudgeVo") IncomePartJudgeVo incomePartJudgeVo,@Param("sql") String sql,@Param("sqlvalue") String sqlvalue);
    //批量插入记录
    int batchInsert(List<IncomePartJudgeVo> listIncomePartJudgeVo);
    //通过订单号查询一条记录
    List<IncomePartJudgeVo> selectByOrderNumber(String orderNumber);
    //excel导入41
    int importInsert(IncomePartJudgeVo incomePartJudgeVo);
    //excel导入35
    int importBasicInsert(IncomePartJudgeVo incomePartJudgeVo);
    //逻辑删除一条记录
    int delete(@Param("id") String id,@Param("userName") String userName);
    //逻辑修改生产计划标识
    int productionPlanDelete(@Param("incomePartJudgeId") String incomePartJudgeId);
    //逻辑修改生产计划标识
    int productPlanDelete(@Param("incomePartJudgeId") String incomePartJudgeId,@Param("deleteFlag")String deleteFlag);
    //通过pks批量逻辑删除记录
    int batchDeleteByPks(List listPks);
    //修改一条记录
    int update(@Param("incomePartJudgeVo") IncomePartJudgeVo incomePartJudgeVo,@Param("sqlupdate") String sqlupdate);
    //通过图号code查询最近一次含税单价
    IncomePartJudgeVo selectUnitPriceByDrawNoCode(String drawNoCode);
    //查询数据库是否有对应图号编码的单价
    int selectUnitPriceCount(String drawNoCode);
    //查询当前最大ID
    String selectMaxId();
    //真实删除一条数据
    int realDelete(String id);

    int updateDoading(String workOrderNumber);

    /**
     * 根据主表id获取目前这个订单号按时间排序 处于第几位
     * @param incomepartjudgeId
     * @param orderNumber
     * @return
     */
    int selectOrderByIdAndOrderNum(int incomepartjudgeId, String orderNumber);
    //通过主表id修改主表数据(deleteFlag=1)
    int updateById(int id);

    /**
     * 获取工单号 workOrderNumber
     * @return
     */
    LinkedHashMap selectWorkOrderNumber(String dataStr);
    //工艺卡片打印查询 deleteflag降序排序
    List<LinkedHashMap> selectProcessCardPrinting(@Param("beginTime") String beginTime ,@Param("endTime")String endTime,@Param("idOrName")String idOrName);
}
